[GENERAL] Geometric, getting x and y co-ordinates from point datatype

Поиск
Список
Период
Сортировка
От Stuart Rison
Тема [GENERAL] Geometric, getting x and y co-ordinates from point datatype
Дата
Msg-id v04020a00b37d50fecaed@[128.40.242.190]
обсуждение исходный текст
Ответы Re: [GENERAL] Geometric, getting x and y co-ordinates GOING MAD!!!!!
Список pgsql-general
Hi there,

Suppose you have a table:

id     pos
1    (0,5)
2    (-1,6)
3    (5.5,9.8)

Are there functions to get to the individual coords such that

SELECT id,get_x(pos),get_y(pos) FROM table;

gives

id    get_x    get_y
1    0    5
2    -1    6
3    5.5    9.8

From doing a bit of snooping about in the Programmer's Guide, I can only
assume that this would involve a modified version point_out.

Are these functions already out there?
If not, can someone give me pointers to the answer?
Would the solution indeed be a modified version of point_out and if so, can
someone give me the point_out source to work with?
(I don't program in C -hell, I don't really program in anything, I dabble-
but I'm quite happy to experiment)

Regards,

Stuart.




+-------------------------+--------------------------------------+
| Stuart Rison            | Ludwig Institute for Cancer Research |
+-------------------------+ 91 Riding House Street               |
| Tel. (0171) 878 4041    | London, W1P 8BT, UNITED KINGDOM.     |
| Fax. (0171) 878 4040    | stuart@ludwig.ucl.ac.uk              |
+-------------------------+--------------------------------------+

В списке pgsql-general по дате отправления:

Предыдущее
От: jim@reptiles.org (Jim Mercer)
Дата:
Сообщение: Re: [GENERAL] Question about indexes.
Следующее
От: James Thompson
Дата:
Сообщение: Re: [GENERAL] Embedded SQL in 'C' (cursors)